<?php

namespace Xin\HttpClient\Interceptors\Responses;

use Xin\HttpClient\Response;

class DecodedInterceptor
{
	/**
	 * @param Response $response
	 * @return array|mixed|object|string|Response|null
	 */
	public function __invoke(Response $response)
	{
		return $response->isSSE() ? $response : $response->decoded();
	}
}
